/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package jps.entities;

import java.io.Serializable;
import javax.persistence.Basic;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.NamedQueries;
import javax.persistence.NamedQuery;
import javax.persistence.Table;
import javax.validation.constraints.NotNull;
import javax.validation.constraints.Size;
import javax.xml.bind.annotation.XmlRootElement;

/**
 *
 * @author Vinicio Gomez
 */
@Entity
@Table(name = "carpoolchoose")
@XmlRootElement
@NamedQueries({
    @NamedQuery(name = "Carpoolchoose.findAll", query = "SELECT c FROM Carpoolchoose c"),
    @NamedQuery(name = "Carpoolchoose.findByEmai", query = "SELECT c FROM Carpoolchoose c WHERE c.emai = :emai")})
public class Carpoolchoose implements Serializable {
    private static final long serialVersionUID = 1L;
    @Id
    @Basic(optional = false)
    @NotNull
    @Size(min = 1, max = 30)
    @Column(name = "Emai")
    private String emai;
    @JoinColumn(name = "ID", referencedColumnName = "ID")
    @ManyToOne(optional = false)
    private Carpoollist id;

    public Carpoolchoose() {
    }

    public Carpoolchoose(String emai) {
        this.emai = emai;
    }

    public String getEmai() {
        return emai;
    }

    public void setEmai(String emai) {
        this.emai = emai;
    }

    public Carpoollist getId() {
        return id;
    }

    public void setId(Carpoollist id) {
        this.id = id;
    }

    @Override
    public int hashCode() {
        int hash = 0;
        hash += (emai != null ? emai.hashCode() : 0);
        return hash;
    }

    @Override
    public boolean equals(Object object) {
        // TODO: Warning - this method won't work in the case the id fields are not set
        if (!(object instanceof Carpoolchoose)) {
            return false;
        }
        Carpoolchoose other = (Carpoolchoose) object;
        if ((this.emai == null && other.emai != null) || (this.emai != null && !this.emai.equals(other.emai))) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        //return "jps.entities.Carpoolchoose[ emai=" + emai + " ]";
        return emai;
    }
    
}
